﻿using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Abp.Modules;
using Abp.Reflection.Extensions;
using Choucius.Boilerplate9.Configuration;
using System.Threading.Tasks;

namespace Choucius.Boilerplate9.Web.Host.Startup
{
    [DependsOn(typeof(Boilerplate9WebCoreModule))]
    public class Boilerplate9WebHostModule: AbpModule
    {
        private readonly IWebHostEnvironment _env;
        private readonly IConfigurationRoot _appConfiguration;

        public Boilerplate9WebHostModule(IWebHostEnvironment env)
        {
            _env = env;
            _appConfiguration = env.GetAppConfiguration();
        }

        public override void PreInitialize()
        {
        }

        public override void Initialize()
        {
            IocManager.Register<MyStartupTask>();
            IocManager.RegisterAssemblyByConvention(typeof(Boilerplate9WebHostModule).GetAssembly());
        }

        public override void PostInitialize()
        {
        }
    }
}
